<load target="js/module_admin.js" usecdn="true" />
<script>
    jQuery( function() { jQuery('.grant_default').change( function(event) { doShowGrantZone(); } ); doShowGrantZone() } );
</script>
<form ruleset="insertModulesGrant" action="./" method="post" id="manageSelectedModuleGrant" class="section x_form-horizontal">
	<input type="hidden" name="module" value="module" />
	<input type="hidden" name="act" value="procModuleAdminModuleGrantSetup" />
	<input type="hidden" name="success_return_url" value="{getRequestUriByServerEnviroment()}" />
	<input type="hidden" name="module_srls" value="{$module_srls}" />
	<input type="hidden" name="xe_validator_id" value="modules/module/tpl/manage_selected" />
    <h1>{$lang->permission_setting}</h1>
    <p>{$lang->about_grant_deatil}</p>
	<div loop="$grant_list => $grant_name, $grant_item" class="x_control-group">
		<label class="x_control-label" for="{$grant_name}_default">{$grant_item->title}</label>
		<div class="x_controls">
			<select name="{$grant_name}_default" id="{$grant_name}_default" class="grant_default">
				<option value="0" cond="$grant_item->default == 'guest'">{$lang->grant_to_all}</option>
				<option value="-1" cond="$grant_item->default != 'manager'">{$lang->grant_to_login_user}</option>
				<option value="-2" cond="$grant_item->default != 'manager'" selected="selected"|cond="$default_grant[$grant_name]=='site'">{$lang->grant_to_site_user}</option>
				<option value="-3">{$lang->grant_to_admin}</option>
				<option value="">{$lang->grant_to_group}</option>
			</select>
			<div id="zone_{$grant_name}" hidden style="margin-top:8px">
				<label loop="$group_list => $group_srl, $group_item" for="grant_{$grant_name}_{$group_srl}">
					<input type="checkbox" name="{$grant_name}[]" value="{$group_item->group_srl}" id="grant_{$grant_name}_{$group_srl}" />
					{$group_item->title}
				</label>
			</div>
		</div>
	</div>
	<div class="btnArea">
		<input type="submit" class="x_btn x_btn-primary" value="{$lang->cmd_registration}" />
	</div>
</form>

